package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Unimed entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "UNIMED", schema = "MANAGER", uniqueConstraints = {})
public class Unimed implements java.io.Serializable {

	// Fields

	private String umdcodigo;
	private String umdnombre;
	private Long umdactivo;
	private Timestamp umdlogfec;
	private Dlluser dlluser;
	private Set<Producto> productos = new HashSet<Producto>(0);
	private Set<Probodega> probodegas = new HashSet<Probodega>(0);
	private Set<Mngmcn> mngmcnsForMcnuniO = new HashSet<Mngmcn>(0);
	private Set<Catvtapro> catvtapros = new HashSet<Catvtapro>(0);
	private Set<Proserie> proseries = new HashSet<Proserie>(0);
	private Set<RequiPro> requiPros = new HashSet<RequiPro>(0);
	private Set<Prounimed> prounimeds = new HashSet<Prounimed>(0);
	private Set<Mngmcn> mngmcnsForMcnunimed = new HashSet<Mngmcn>(0);

	// Constructors

	/** default constructor */
	public Unimed() {
	}

	/** minimal constructor */
	public Unimed(String umdcodigo) {
		this.umdcodigo = umdcodigo;
	}

	/** full constructor */
	public Unimed(String umdcodigo, String umdnombre, Long umdactivo,
			Set<Producto> productos, Set<Probodega> probodegas,
			Dlluser dlluser,Timestamp umdlogfec,
			Set<Mngmcn> mngmcnsForMcnuniO, Set<Catvtapro> catvtapros,
			Set<Proserie> proseries, Set<RequiPro> requiPros,
			Set<Prounimed> prounimeds, Set<Mngmcn> mngmcnsForMcnunimed) {
		this.umdcodigo = umdcodigo;
		this.umdnombre = umdnombre;
		this.umdactivo = umdactivo;
		this.productos = productos;
		this.umdlogfec = umdlogfec;
		this.dlluser = dlluser;
		this.probodegas = probodegas;
		this.mngmcnsForMcnuniO = mngmcnsForMcnuniO;
		this.catvtapros = catvtapros;
		this.proseries = proseries;
		this.requiPros = requiPros;
		this.prounimeds = prounimeds;
		this.mngmcnsForMcnunimed = mngmcnsForMcnunimed;
	}

	// Property accessors
	@Id
	@Column(name = "UMDCODIGO", unique = true, nullable = false, insertable = true, updatable = true, length = 4)
	public String getUmdcodigo() {
		return this.umdcodigo;
	}

	public void setUmdcodigo(String umdcodigo) {
		this.umdcodigo = umdcodigo;
	}

	@Column(name = "UMDNOMBRE", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public String getUmdnombre() {
		return this.umdnombre;
	}

	public void setUmdnombre(String umdnombre) {
		this.umdnombre = umdnombre;
	}

	@Column(name = "UMDACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getUmdactivo() {
		return this.umdactivo;
	}

	public void setUmdactivo(Long umdactivo) {
		this.umdactivo = umdactivo;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimed")
	public Set<Producto> getProductos() {
		return this.productos;
	}

	public void setProductos(Set<Producto> productos) {
		this.productos = productos;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "UMDLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "UMDLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getUmdlogfec() {
		return this.umdlogfec;
	}

	public void setUmdlogfec(Timestamp umdlogfec) {
		this.umdlogfec = umdlogfec;
	}
	
	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimed")
	public Set<Probodega> getProbodegas() {
		return this.probodegas;
	}

	public void setProbodegas(Set<Probodega> probodegas) {
		this.probodegas = probodegas;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimedByMcnuniO")
	public Set<Mngmcn> getMngmcnsForMcnuniO() {
		return this.mngmcnsForMcnuniO;
	}

	public void setMngmcnsForMcnuniO(Set<Mngmcn> mngmcnsForMcnuniO) {
		this.mngmcnsForMcnuniO = mngmcnsForMcnuniO;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimed")
	public Set<Catvtapro> getCatvtapros() {
		return this.catvtapros;
	}

	public void setCatvtapros(Set<Catvtapro> catvtapros) {
		this.catvtapros = catvtapros;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimed")
	public Set<Proserie> getProseries() {
		return this.proseries;
	}

	public void setProseries(Set<Proserie> proseries) {
		this.proseries = proseries;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimed")
	public Set<RequiPro> getRequiPros() {
		return this.requiPros;
	}

	public void setRequiPros(Set<RequiPro> requiPros) {
		this.requiPros = requiPros;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimed")
	public Set<Prounimed> getProunimeds() {
		return this.prounimeds;
	}

	public void setProunimeds(Set<Prounimed> prounimeds) {
		this.prounimeds = prounimeds;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "unimedByMcnunimed")
	public Set<Mngmcn> getMngmcnsForMcnunimed() {
		return this.mngmcnsForMcnunimed;
	}

	public void setMngmcnsForMcnunimed(Set<Mngmcn> mngmcnsForMcnunimed) {
		this.mngmcnsForMcnunimed = mngmcnsForMcnunimed;
	}

}